home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / tcp / HyperMail102.lha / HyperMail / libcgi / syn_url.c < prev    next >
C/C++ Source or Header  |  1995-06-18  |  694b  |  33 lines

  1. /*
  2.  * This file is part of the LIBCGI library
  3.  *
  4.  * Copyright 1994 by Enterprise Integration Technologies Corporation
  5.  *
  6.  * This is freeware with commercialization rights reserved; see the
  7.  * LICENSE included in the distribution for specifics.
  8.  */
  9.  
  10. #include <stdio.h>
  11. #include "cgi.h"
  12.  
  13. int syn_base_url(buf, ci)
  14.      char *buf;
  15.      cgi_info *ci;
  16. {
  17.   int x;
  18.  
  19.   if (ci && buf) {
  20.     x = (int) sprintf(buf, "http://%s:%s%s", ci->server_name, ci->server_port,
  21.         ci->script_name);
  22.     return (x && x != EOF);
  23.   } else return 0;
  24. }
  25.  
  26. int print_base_url(ci)
  27.      cgi_info *ci;
  28. {
  29.   return (ci &&
  30.           (printf("http://%s:%s%s", ci->server_name, ci->server_port,
  31.         ci->script_name) != EOF));
  32. }
  33.